import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        socket: null,
        socketId: null,
    },
    mutations: {
        joinSocket(state, socket) {
            state.socket = socket
            state.socketId = socket.id
        },
    },
    getters: {
        socket(state) {
            return state.socket
        },
        socketId(state) {
            return state.socketId
        },
    },
    actions: {},
    modules: {}
})
